const { assert, expect } = require("chai")
const { getNamedAccounts, deployments ,ethers} = require("hardhat")

describe("Mytoke", async function() {

    let firstAccount
    let task02
    let secondAccount
    beforeEach(async function() {
        await deployments.fixture(["Task03"])
        firstAccount = (await getNamedAccounts()).firstAccount
        secondAccount = (await getNamedAccounts()).secondAccount
        const fundMeDeployment = await deployments.get("Task02")
        console.log(fundMeDeployment.address)

        // console.log(firstAccount)
        task02 = await ethers.getContractAt("Task02", fundMeDeployment.address)
    })
    it("test if mint is right", async function () {
       //  console.log(ethers.parseEther(1))
       await task02.mint(firstAccount,5)
        assert.equal(await task02.balanceOf(firstAccount), 5)
    })

})